﻿//===================================================================
// 西交通开发框架-XCI.Parent 2019 版权所有     
//===================================================================
using System;
using System.ComponentModel.DataAnnotations;
using XCI.Data.Entity;

namespace XCI.Sys.Model
{
    /// <summary>
    /// 系统历史记录
    /// </summary>
    [Table("系统历史记录")]
    public class SysHistory
    {
        /// <summary>
        /// 历史记录主键
        /// </summary>
        [Primary]
        [Column("历史记录主键", false)]
        public string Id { get; set; }

        /// <summary>
        /// 操作类型(1:新建;2:修改;3:删除)
        /// </summary>
        [Column("操作类型")]
        public bool? OperateType { get; set; }

        /// <summary>
        /// 操作类型(1:操作;2:登录;3:异常)
        /// </summary>
        [Column("操作类型")]
        public string OperateTypeText { get; set; }

        /// <summary>
        /// 表名
        /// </summary>
        [Column("表名")]
        [Required(ErrorMessage = "请输入表名")]
        [StringLength(100, ErrorMessage = "表名不能超过100个字符")]
        public string TableName { get; set; }

        /// <summary>
        /// 主键
        /// </summary>
        [Column("主键")]
        [Required(ErrorMessage = "请输入主键")]
        [StringLength(100, ErrorMessage = "主键不能超过100个字符")]
        public string PrimaryKey { get; set; }

        /// <summary>
        /// 操作前数据
        /// </summary>
        [Column("操作前数据")]
        public string BeforeData { get; set; }

        /// <summary>
        /// 操作后数据
        /// </summary>
        [Column("操作后数据")]
        public string AfterData { get; set; }

        /// <summary>
        /// 消息
        /// </summary>
        [Column("消息")]
        [StringLength(1000, ErrorMessage = "消息不能超过1000个字符")]
        public string Message { get; set; }

        /// <summary>
        /// 操作人主键
        /// </summary>
        [Column("操作人主键")]
        public string OperateUserId { get; set; }

        /// <summary>
        /// 操作人姓名
        /// </summary>
        [Column("操作人姓名")]
        [StringLength(100, ErrorMessage = "操作人姓名不能超过100个字符")]
        public string OperateUserName { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        [Column("操作时间")]
        public DateTime? OperateDateTime { get; set; }

        /// <summary>
        /// 复制对象
        /// </summary>
        public SysHistory Clone()
        {
            return (SysHistory)MemberwiseClone();
        }
    }
}
